﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NestedMasterPage.master" %>

<%@ Register TagPrefix="Page" TagName="Nav" Src="~/UserControls/PageControl.ascx" %>

<script runat="server">
  protected void Page_Load(object sender, EventArgs e)
  {
    if (!Page.IsPostBack)
    {
      B2C_MALL_HOME ws = new B2C_MALL_HOME();
      ws.Url = ConfigurationManager.AppSettings["B2C_MALL_HOME"].ToString(); 
      string jsonString = ws.B2C_MALL_GetMallFAQ(System.Configuration.ConfigurationManager.AppSettings["WebDeviceid"].ToString()
        , HttpContext.Current.User.Identity.Name);
      JObject restoredObject = JsonConvert.DeserializeObject<JObject>(jsonString);
      if (restoredObject != null)
      {
        string Is_Valid = restoredObject["Is_Valid"].ToString();
        string msg = restoredObject["Msg"].ToString();

        if (Is_Valid == "Y")
        {
          dynamic dynObj = restoredObject["GetMallFAQAry"];
          this.ListViewFAQ.DataSource = dynObj;
          this.ListViewFAQ.DataBind();
        }
      }
    }
  }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="NestedContent" runat="server">

  <div class="breadcrumbs dotted">
    <a href="Home.aspx">首頁</a> / <a href="FAQ.aspx" class="current">FAQ</a>
  </div>
  <div class="inner">
    <h1>FAQ</h1>
    <div class="askget faq">
      <asp:ListView ID="ListViewFAQ" runat="server">
        <ItemTemplate>
          <div class="askget-item">
            <div class="titler">
              <%# Server.HtmlEncode(Eval("Question").ToString()) %>
            </div>
            <div class="desc">
              <p><%# Server.HtmlEncode(Eval("Answer").ToString()) %></p>
            </div>
          </div>
        </ItemTemplate>
      </asp:ListView>
    </div>
  </div>
  <div class="go-to-top">
    <a href="#">回到頂端</a>
  </div>
</asp:Content>
